package org.larkdoc.model.vo;

import java.io.Serializable;

import org.larkdoc.constant.ViewConts;

/**
 * 视图返回的基础类对象
 * 
 * @author tmmk
 * @version [v0.0.1, 2016年7月12日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class RespBaseVO implements Serializable {
    
    /**
     * 注释内容
     */
    private static final long serialVersionUID = 1L;
    
    /**
     * 操作状态码
     * 为了避免与其它熟悉冲突，故取名：retCode
     */
    Integer                       retCode;
    
    /**
     * 描述
     * 为了避免与其它熟悉冲突，故取名：retMsg
     */
    String                    retMsg;
    
    /**
     * 操作結果值：
     * 为了避免与其它熟悉冲突，故取名：retVal
     * 示例：判断用户名是否已存在时：retVal = true,
     * 也可以是一个数据对象
     */
    Object                    retVal;
    
    /**
     * 默认：retCode = ViewConts.Code.SUCCESS
     */
    public RespBaseVO() {
        this.retCode = ViewConts.Code.SUCCESS;
        this.retMsg = ViewConts.Msg.SUCCESS;
    }
    
    public RespBaseVO(Integer code, String msg, Object val) {
        this.retCode = code;
        this.retMsg = msg;
        this.retVal = val;
    }
    
    public RespBaseVO(Object val) {
        this(ViewConts.Code.SUCCESS, ViewConts.Msg.SUCCESS, val);
    }
    
    public static long getSerialversionuid() {
        return serialVersionUID;
    }
    
    public Integer getRetCode() {
        return retCode;
    }
    
    public void setRetCode(int retCode) {
        this.retCode = retCode;
    }
    
    public String getRetMsg() {
        return retMsg;
    }
    
    public void setRetMsg(String retMsg) {
        this.retMsg = retMsg;
    }
    
    public Object getRetVal() {
        return retVal;
    }
    
    public void setRetVal(Object retVal) {
        this.retVal = retVal;
    }
    
    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("ResponseBaseVO [retCode=");
        builder.append(retCode);
        builder.append(", retMsg=");
        builder.append(retMsg);
        builder.append(", retVal=");
        builder.append(retVal);
        builder.append("]");
        return builder.toString();
    }
    
}
